package springframework.bean;

import java.util.Random;

/**
 * @author Cedric
 * @date 2021/11/16 11:28
 * @description 定义一个Bean组件
 */
public class UserService implements IUserService {

    private String token;

    @Override
    public void queryUserInfo() {
        try {
            Thread.sleep(new Random(1).nextInt(100));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("查询用户" + token + "信息");
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }
}
